<?php

class Contacts extends CI_Controller {
    
    private $_auth;
    public function __construct() {
        parent::__construct();
        $this->_auth = $this->myclass->checkuser();
        if($this->_auth == FALSE) redirect ("backend/home");
    }
    
    public function index(){
        $data['data']['orders']= $this->mcontacts->fetchAll();
        $data['title'] = "Bảng liên hệ";
        $data['temp'] = "backend/contacts/home";
        $this->load->view("backend/layout/index",$data);
    }
    
    public function delete($id) {
        $this->mcontacts->delete($id);
        redirect("backend/contacts");
    }
    
    public function deleteAll() {
        $this->mcontacts->deleteAll();
        redirect("backend/contacts");
    }
    
    
    
}
